package Task22;

import java.util.HashMap;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            String str = in.next();
            HashMap<Character,Integer> hashMap = new HashMap<>();
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(!hashMap.containsKey(ch)){
                    hashMap.put(ch,1);
                }else {
                     hashMap.put(ch, hashMap.get(ch) + 1);
                }
            }
            for (int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(hashMap.get(ch) == 1){
                    System.out.println(ch);
                    return;
                }
            }
            System.out.println(-1);
        }
    }
}
